﻿<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
      <title>MessageHelper 类
 | Fantasy.Net API Reference </title>
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <meta name="title" content="MessageHelper 类
 | Fantasy.Net API Reference ">
      
      <link rel="icon" href="../favicon.ico">
      <link rel="stylesheet" href="../public/docfx.min.css">
      <link rel="stylesheet" href="../public/main.css">
      <meta name="docfx:navrel" content="../toc.html">
      <meta name="docfx:tocrel" content="toc.html">
      
      <meta name="docfx:rel" content="../">
      
      
      
  </head>

  <script type="module">
    import options from './../public/main.js'
    import { init } from './../public/docfx.min.js'
    init(options)
  </script>

  <script>
    const theme = localStorage.getItem('theme') || 'auto'
    document.documentElement.setAttribute('data-bs-theme', theme === 'auto' ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') : theme)
  </script>

  <body class="tex2jax_ignore" data-layout="" data-yaml-mime="ManagedReference">
    <header class="bg-body border-bottom">
      <nav id="autocollapse" class="navbar navbar-expand-md" role="navigation">
        <div class="container-xxl flex-nowrap">
          <a class="navbar-brand" href="../index.html">
            <img id="logo" class="svg" src="../logo.svg" alt="Fantasy.Net">
            Fantasy.Net
          </a>
          <button class="btn btn-lg d-md-none border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navpanel" aria-controls="navpanel" aria-expanded="false" aria-label="Toggle navigation">
            <i class="bi bi-three-dots"></i>
          </button>
          <div class="collapse navbar-collapse" id="navpanel">
            <div id="navbar">
              <form class="search" role="search" id="search">
                <i class="bi bi-search"></i>
                <input class="form-control" id="search-query" type="search" disabled="" placeholder="搜索" autocomplete="off" aria-label="Search">
              </form>
            </div>
          </div>
        </div>
      </nav>
    </header>

    <main class="container-xxl">
      <div class="toc-offcanvas">
        <div class="offcanvas-md offcanvas-start" tabindex="-1" id="tocOffcanvas" aria-labelledby="tocOffcanvasLabel">
          <div class="offcanvas-header">
            <h5 class="offcanvas-title" id="tocOffcanvasLabel">Table of Contents</h5>
            <button type="button" class="btn-close" data-bs-dismiss="offcanvas" data-bs-target="#tocOffcanvas" aria-label="Close"></button>
          </div>
          <div class="offcanvas-body">
            <nav class="toc" id="toc"></nav>
          </div>
        </div>
      </div>

      <div class="content">
        <div class="actionbar">
          <button class="btn btn-lg border-0 d-md-none" style="margin-top: -.65em; margin-left: -.8em" type="button" data-bs-toggle="offcanvas" data-bs-target="#tocOffcanvas" aria-controls="tocOffcanvas" aria-expanded="false" aria-label="Show table of contents">
            <i class="bi bi-list"></i>
          </button>

          <nav id="breadcrumb"></nav>
        </div>

        <article data-uid="Fantasy.Core.Network.MessageHelper">



  <h1 id="Fantasy_Core_Network_MessageHelper" data-uid="Fantasy.Core.Network.MessageHelper" class="text-break">
    MessageHelper 类
  
  </h1>

  <div class="facts text-secondary">
    <dl><dt>命名空间</dt><dd><a class="xref" href="Fantasy.html">Fantasy</a>.<a class="xref" href="Fantasy.Core.html">Core</a>.<a class="xref" href="Fantasy.Core.Network.html">Network</a></dd></dl>
  <dl><dt>程序集</dt><dd>Fantasy.Net.dll</dd></dl>
  </div>

  <div class="markdown summary"></div>
  <div class="markdown conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static class MessageHelper</code></pre>
  </div>




  <dl class="typelist inheritance">
    <dt>继承</dt>
    <dd>
      <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
      <div><span class="xref">MessageHelper</span></div>
    </dd>
  </dl>



  <dl class="typelist derived">
    <dt>继承成员</dt>
    <dd>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone">object.MemberwiseClone()</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object, object)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object, object)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a>
    </div>
  </dd></dl>






  <h2 class="section" id="fields">字段
</h2>



  <h3 id="Fantasy_Core_Network_MessageHelper_RequestCallback" data-uid="Fantasy.Core.Network.MessageHelper.RequestCallback">
  RequestCallback
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static readonly SortedDictionary&lt;uint, MessageSender&gt; RequestCallback</code></pre>
  </div>




  <h4 class="section">字段值</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.sorteddictionary-2">SortedDictionary</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.uint32">uint</a>, <a class="xref" href="Fantasy.Core.Network.MessageSender.html">MessageSender</a>&gt;</dt>
    <dd></dd>
  </dl>










  <h3 id="Fantasy_Core_Network_MessageHelper_Timeout" data-uid="Fantasy.Core.Network.MessageHelper.Timeout">
  Timeout
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public const long Timeout = 40000</code></pre>
  </div>




  <h4 class="section">字段值</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></dt>
    <dd></dd>
  </dl>










  <h3 id="Fantasy_Core_Network_MessageHelper_TimeoutRouteMessageSenders" data-uid="Fantasy.Core.Network.MessageHelper.TimeoutRouteMessageSenders">
  TimeoutRouteMessageSenders
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static readonly Dictionary&lt;uint, MessageSender&gt; TimeoutRouteMessageSenders</code></pre>
  </div>




  <h4 class="section">字段值</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary-2">Dictionary</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.uint32">uint</a>, <a class="xref" href="Fantasy.Core.Network.MessageSender.html">MessageSender</a>&gt;</dt>
    <dd></dd>
  </dl>









  <h2 class="section" id="methods">方法
</h2>


  <a id="Fantasy_Core_Network_MessageHelper_CallAddressable_" data-uid="Fantasy.Core.Network.MessageHelper.CallAddressable*"></a>

  <h3 id="Fantasy_Core_Network_MessageHelper_CallAddressable_Fantasy_Scene_System_Int64_Fantasy_Core_Network_IRouteMessage_" data-uid="Fantasy.Core.Network.MessageHelper.CallAddressable(Fantasy.Scene,System.Int64,Fantasy.Core.Network.IRouteMessage)">
  CallAddressable(Scene, long, IRouteMessage)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static FTask&lt;IResponse&gt; CallAddressable(Scene scene, long addressableId, IRouteMessage request)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>scene</code> <a class="xref" href="Fantasy.Scene.html">Scene</a></dt>
    <dd></dd>
    <dt><code>addressableId</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></dt>
    <dd></dd>
    <dt><code>request</code> <a class="xref" href="Fantasy.Core.Network.IRouteMessage.html">IRouteMessage</a></dt>
    <dd></dd>
  </dl>

  <h4 class="section">返回</h4>
  <dl class="parameters">
    <dt><a class="xref" href="Fantasy.FTask-1.html">FTask</a>&lt;<a class="xref" href="Fantasy.Core.Network.IResponse.html">IResponse</a>&gt;</dt>
    <dd></dd>
  </dl>











  <a id="Fantasy_Core_Network_MessageHelper_CallInnerRoute_" data-uid="Fantasy.Core.Network.MessageHelper.CallInnerRoute*"></a>

  <h3 id="Fantasy_Core_Network_MessageHelper_CallInnerRoute_Fantasy_Scene_System_Int64_Fantasy_Core_Network_IRouteMessage_" data-uid="Fantasy.Core.Network.MessageHelper.CallInnerRoute(Fantasy.Scene,System.Int64,Fantasy.Core.Network.IRouteMessage)">
  CallInnerRoute(Scene, long, IRouteMessage)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static FTask&lt;IResponse&gt; CallInnerRoute(Scene scene, long entityId, IRouteMessage request)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>scene</code> <a class="xref" href="Fantasy.Scene.html">Scene</a></dt>
    <dd></dd>
    <dt><code>entityId</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></dt>
    <dd></dd>
    <dt><code>request</code> <a class="xref" href="Fantasy.Core.Network.IRouteMessage.html">IRouteMessage</a></dt>
    <dd></dd>
  </dl>

  <h4 class="section">返回</h4>
  <dl class="parameters">
    <dt><a class="xref" href="Fantasy.FTask-1.html">FTask</a>&lt;<a class="xref" href="Fantasy.Core.Network.IResponse.html">IResponse</a>&gt;</dt>
    <dd></dd>
  </dl>











  <a id="Fantasy_Core_Network_MessageHelper_CallInnerRoute_" data-uid="Fantasy.Core.Network.MessageHelper.CallInnerRoute*"></a>

  <h3 id="Fantasy_Core_Network_MessageHelper_CallInnerRoute_Fantasy_Scene_System_Int64_System_Int64_System_Type_System_IO_MemoryStream_" data-uid="Fantasy.Core.Network.MessageHelper.CallInnerRoute(Fantasy.Scene,System.Int64,System.Int64,System.Type,System.IO.MemoryStream)">
  CallInnerRoute(Scene, long, long, Type, MemoryStream)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static FTask&lt;IResponse&gt; CallInnerRoute(Scene scene, long entityId, long routeTypeOpCode, Type requestType, MemoryStream request)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>scene</code> <a class="xref" href="Fantasy.Scene.html">Scene</a></dt>
    <dd></dd>
    <dt><code>entityId</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></dt>
    <dd></dd>
    <dt><code>routeTypeOpCode</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></dt>
    <dd></dd>
    <dt><code>requestType</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.type">Type</a></dt>
    <dd></dd>
    <dt><code>request</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.memorystream">MemoryStream</a></dt>
    <dd></dd>
  </dl>

  <h4 class="section">返回</h4>
  <dl class="parameters">
    <dt><a class="xref" href="Fantasy.FTask-1.html">FTask</a>&lt;<a class="xref" href="Fantasy.Core.Network.IResponse.html">IResponse</a>&gt;</dt>
    <dd></dd>
  </dl>











  <a id="Fantasy_Core_Network_MessageHelper_CallInnerServer_" data-uid="Fantasy.Core.Network.MessageHelper.CallInnerServer*"></a>

  <h3 id="Fantasy_Core_Network_MessageHelper_CallInnerServer_Fantasy_Scene_System_UInt32_Fantasy_Core_Network_IRequest_" data-uid="Fantasy.Core.Network.MessageHelper.CallInnerServer(Fantasy.Scene,System.UInt32,Fantasy.Core.Network.IRequest)">
  CallInnerServer(Scene, uint, IRequest)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static FTask&lt;IResponse&gt; CallInnerServer(Scene scene, uint targetServerId, IRequest request)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>scene</code> <a class="xref" href="Fantasy.Scene.html">Scene</a></dt>
    <dd></dd>
    <dt><code>targetServerId</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.uint32">uint</a></dt>
    <dd></dd>
    <dt><code>request</code> <a class="xref" href="Fantasy.Core.Network.IRequest.html">IRequest</a></dt>
    <dd></dd>
  </dl>

  <h4 class="section">返回</h4>
  <dl class="parameters">
    <dt><a class="xref" href="Fantasy.FTask-1.html">FTask</a>&lt;<a class="xref" href="Fantasy.Core.Network.IResponse.html">IResponse</a>&gt;</dt>
    <dd></dd>
  </dl>











  <a id="Fantasy_Core_Network_MessageHelper_ResponseHandler_" data-uid="Fantasy.Core.Network.MessageHelper.ResponseHandler*"></a>

  <h3 id="Fantasy_Core_Network_MessageHelper_ResponseHandler_System_UInt32_Fantasy_Core_Network_IResponse_" data-uid="Fantasy.Core.Network.MessageHelper.ResponseHandler(System.UInt32,Fantasy.Core.Network.IResponse)">
  ResponseHandler(uint, IResponse)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static void ResponseHandler(uint rpcId, IResponse response)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>rpcId</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.uint32">uint</a></dt>
    <dd></dd>
    <dt><code>response</code> <a class="xref" href="Fantasy.Core.Network.IResponse.html">IResponse</a></dt>
    <dd></dd>
  </dl>












  <a id="Fantasy_Core_Network_MessageHelper_SendAddressable_" data-uid="Fantasy.Core.Network.MessageHelper.SendAddressable*"></a>

  <h3 id="Fantasy_Core_Network_MessageHelper_SendAddressable_Fantasy_Scene_System_Int64_Fantasy_Core_Network_IRouteMessage_" data-uid="Fantasy.Core.Network.MessageHelper.SendAddressable(Fantasy.Scene,System.Int64,Fantasy.Core.Network.IRouteMessage)">
  SendAddressable(Scene, long, IRouteMessage)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static void SendAddressable(Scene scene, long addressableId, IRouteMessage message)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>scene</code> <a class="xref" href="Fantasy.Scene.html">Scene</a></dt>
    <dd></dd>
    <dt><code>addressableId</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></dt>
    <dd></dd>
    <dt><code>message</code> <a class="xref" href="Fantasy.Core.Network.IRouteMessage.html">IRouteMessage</a></dt>
    <dd></dd>
  </dl>












  <a id="Fantasy_Core_Network_MessageHelper_SendInnerRoute_" data-uid="Fantasy.Core.Network.MessageHelper.SendInnerRoute*"></a>

  <h3 id="Fantasy_Core_Network_MessageHelper_SendInnerRoute_Fantasy_Scene_System_Collections_Generic_ICollection_System_Int64__Fantasy_Core_Network_IRouteMessage_" data-uid="Fantasy.Core.Network.MessageHelper.SendInnerRoute(Fantasy.Scene,System.Collections.Generic.ICollection{System.Int64},Fantasy.Core.Network.IRouteMessage)">
  SendInnerRoute(Scene, ICollection&lt;long&gt;, IRouteMessage)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static void SendInnerRoute(Scene scene, ICollection&lt;long&gt; routeIdCollection, IRouteMessage message)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>scene</code> <a class="xref" href="Fantasy.Scene.html">Scene</a></dt>
    <dd></dd>
    <dt><code>routeIdCollection</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.icollection-1">ICollection</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a>&gt;</dt>
    <dd></dd>
    <dt><code>message</code> <a class="xref" href="Fantasy.Core.Network.IRouteMessage.html">IRouteMessage</a></dt>
    <dd></dd>
  </dl>












  <a id="Fantasy_Core_Network_MessageHelper_SendInnerRoute_" data-uid="Fantasy.Core.Network.MessageHelper.SendInnerRoute*"></a>

  <h3 id="Fantasy_Core_Network_MessageHelper_SendInnerRoute_Fantasy_Scene_System_Int64_Fantasy_Core_Network_IRouteMessage_" data-uid="Fantasy.Core.Network.MessageHelper.SendInnerRoute(Fantasy.Scene,System.Int64,Fantasy.Core.Network.IRouteMessage)">
  SendInnerRoute(Scene, long, IRouteMessage)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static void SendInnerRoute(Scene scene, long entityId, IRouteMessage message)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>scene</code> <a class="xref" href="Fantasy.Scene.html">Scene</a></dt>
    <dd></dd>
    <dt><code>entityId</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></dt>
    <dd></dd>
    <dt><code>message</code> <a class="xref" href="Fantasy.Core.Network.IRouteMessage.html">IRouteMessage</a></dt>
    <dd></dd>
  </dl>












  <a id="Fantasy_Core_Network_MessageHelper_SendInnerRoute_" data-uid="Fantasy.Core.Network.MessageHelper.SendInnerRoute*"></a>

  <h3 id="Fantasy_Core_Network_MessageHelper_SendInnerRoute_Fantasy_Scene_System_Int64_System_Int64_System_IO_MemoryStream_" data-uid="Fantasy.Core.Network.MessageHelper.SendInnerRoute(Fantasy.Scene,System.Int64,System.Int64,System.IO.MemoryStream)">
  SendInnerRoute(Scene, long, long, MemoryStream)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static void SendInnerRoute(Scene scene, long entityId, long routeTypeOpCode, MemoryStream message)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>scene</code> <a class="xref" href="Fantasy.Scene.html">Scene</a></dt>
    <dd></dd>
    <dt><code>entityId</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></dt>
    <dd></dd>
    <dt><code>routeTypeOpCode</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></dt>
    <dd></dd>
    <dt><code>message</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.memorystream">MemoryStream</a></dt>
    <dd></dd>
  </dl>












  <a id="Fantasy_Core_Network_MessageHelper_SendInnerServer_" data-uid="Fantasy.Core.Network.MessageHelper.SendInnerServer*"></a>

  <h3 id="Fantasy_Core_Network_MessageHelper_SendInnerServer_Fantasy_Scene_System_UInt32_Fantasy_Core_Network_IMessage_" data-uid="Fantasy.Core.Network.MessageHelper.SendInnerServer(Fantasy.Scene,System.UInt32,Fantasy.Core.Network.IMessage)">
  SendInnerServer(Scene, uint, IMessage)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static void SendInnerServer(Scene scene, uint routeId, IMessage message)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>scene</code> <a class="xref" href="Fantasy.Scene.html">Scene</a></dt>
    <dd></dd>
    <dt><code>routeId</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.uint32">uint</a></dt>
    <dd></dd>
    <dt><code>message</code> <a class="xref" href="Fantasy.Core.Network.IMessage.html">IMessage</a></dt>
    <dd></dd>
  </dl>













</article>


        
      </div>

      <div class="affix">
        <nav id="affix"></nav>
      </div>
    </main>

    <div class="container-xxl search-results" id="search-results"></div>

    <footer class="border-top">
      <div class="container-xxl">
        <div class="flex-fill">
          <span>Made with <a href="https://dotnet.github.io/docfx">docfx</a></span>
        </div>
      </div>
    </footer>
  </body>
</html>